package TestObjects;

import java.awt.Polygon;
import java.util.ArrayList;

import GameObjects.Instances.Instance;
import GameObjects.Instances.Instances;
import GameObjects.Physics.Position;
import GameObjects.Ships.Weapon.Weapon;

/**
 * To test new weapona, shooting stratagies and bullet types with. Is used by TestShip only
 * @author Henry
 *
 */

public class TestWeapon extends Weapon 
{
	private static final Instances instances = makeInstances();
	private static final double energyCost = 10;

	public TestWeapon(double x, double y, double theta, double health) 
	{
		//The position of the Weapon is relative to the ship it is attached too
		//The x, y, theta position on the ships bounds
		super(instances, new Position(x, y, theta), health, new ShootingTypeTest(), energyCost);
		// TODO Auto-generated constructor stub
	}
	
	private static Instances makeInstances()
	{
		Polygon bounds = new Polygon();
		bounds.addPoint(0, 0);
		bounds.addPoint(50, 0);
		bounds.addPoint(50, 10);
		bounds.addPoint(0, 10);	
		Instance inst = new Instance(null, 50, 10, bounds);
		ArrayList<Instance> instsa = new ArrayList<Instance>();
		instsa.add(inst);
		return new Instances(instsa, 1);
	}
}
